package com.wink_172.library.utils



/**
 *
 * 日志管理工具
 * */
object LogUtil {
    private val TAG = "LogUtil"
    var uploading = false //是否有日志在上传中
    var log_name: String = "未初始化_.txt"     //上传日志的名称
    var save_log_path = ""


    /**
     * 追加到日志文件
     * */
    fun appendToLog(result: String) {

        val time = System.currentTimeMillis()

        CommonJavaUtils.appendTxtToFile(
            "\n时间：" + DateUtil.longToString(time, DateUtil.FORMAT_TIME) +
                    "\n " + result,
            save_log_path,
            log_name
        )
    }

    /**
     * 显示当前日志文件
     * */
    fun getCurrentLog():String {

        val result = CommonJavaUtils.readTxtFile(save_log_path, log_name)
        return result
    }


}